/****** Object:  Table [dbo].[System]    Script Date: 01/19/2012 17:19:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[System](
	[Name] [nvarchar](1024) NOT NULL,
	[Value] [nvarchar](1024) NOT NULL
)
GO
INSERT [dbo].[System] ([Name], [Value]) VALUES (N'updated.version', N'0')
/****** Object:  Table [dbo].[DiaryItem]    Script Date: 01/19/2012 17:19:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DiaryItem](
	[ID] [uniqueidentifier] NOT NULL,
	[Content] [nvarchar](4000) NOT NULL,
	[UpdatedVersion] [bigint] NOT NULL,
	[UpdatedDeviceID] [uniqueidentifier] NOT NULL,
	[BasedVersion] [bigint] NOT NULL,
	[BasedDeviceID] [uniqueidentifier] NOT NULL,
	[IsDeleted] [bit] NOT NULL,
 CONSTRAINT [PK_DiaryItem] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF)
)
GO
/****** Object:  Default [DF_DiaryItem_ID]    Script Date: 01/19/2012 17:19:18 ******/
ALTER TABLE [dbo].[DiaryItem] ADD  CONSTRAINT [DF_DiaryItem_ID]  DEFAULT (newid()) FOR [ID]
GO
/****** Object:  Default [DF_DiaryItem_IsDeleted]    Script Date: 01/19/2012 17:19:18 ******/
ALTER TABLE [dbo].[DiaryItem] ADD  CONSTRAINT [DF_DiaryItem_IsDeleted]  DEFAULT ((0)) FOR [IsDeleted]
GO
